﻿@model TissotWeb.GoogleMaps.Models.GoogleMapPartViewModel

@{
    Script.Include("https://maps.google.com/maps/api/js?key=" + Model.ApiKey + "&sensor=true").AtFoot();
    Script.Require("AdminMapInit").AtFoot();
}

<fieldset>
    <h2>Search google maps for coordinates: </h2>
    @Html.Label("gmap-search","Type an address here")
    @Html.TextBox("gmap-search","",new {id="gmap-search-input", @class="text medium", placeholder="Type an address here"})
    <button id="gmap-search-button" >Search</button>
</fieldset>

<fieldset>
    <div id="gmap-map"></div>
</fieldset>
<fieldset>
    @Html.LabelFor(m => m.Latitude, T("Latitude"))
    @Html.TextBoxFor(m => m.Latitude, new{id="gmap-latitude", @class="text medium"})
</fieldset>

<fieldset>
    @Html.LabelFor(m => m.Longitude, T("Longitude"))
    @Html.TextBoxFor(m => m.Longitude, new { id = "gmap-longitude", @class = "text medium" })
</fieldset>


@using (Script.Foot())
{
    <script> init_map('gmap-map', 'gmap-search-button', 'gmap-search-input', 'gmap-latitude', 'gmap-longitude');</script>
}
